import * as constants from './constants';
import { fromJS } from 'immutable';

// immutable库  确保state不会被修改
// immutable对象

const defaultState = fromJS({
    menuList: null
});

export default (state = defaultState, action) => {
    switch(action.type) {
        case constants.INIT_MENU:
            return state.set('menuList', action.menu);
        default:
            return state;
    }
}